var times = 60;
var time =null;
window.onload = function () {
    var button = document.getElementById("button");
    button.onclick = function () {
        time = setInterval(function () {
            if(times==0){
                button.value = "获取验证码";
                button.disabled = "";
                times = 60;
                clearInterval(time);
            }else{
                button.value = times+"s";
                times--;
                button.disabled = "true";
            }
        },1000)
    }
}